package com.boatAnchorAssistant.service.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.boatAnchorAssistant.pojo.dto.department.GetDepartmentListDto;
import com.boatAnchorAssistant.pojo.entity.Department;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

    import com.boatAnchorAssistant.pojo.dto.department.SelectDepartmentDto;
    import com.baomidou.mybatisplus.extension.plugins.pagination.Page;

import java.util.List;

/**
* 【描 述】：
* 【环 境】：J2SE
* 【详 细】：
*
*/
@Repository
public interface DepartmentMapper extends BaseMapper< Department > {

    /**
    * 搜索部门
    * @param dto
    * @return
    */
    Page< Department > selectDepartment(SelectDepartmentDto dto);


    /**
     * 获取部门列表
     *
     * @param dto
     * @return
     */
    List<Department> getDepartmentListByDto(GetDepartmentListDto dto);


    /**
     * 删除企业下的部门
     *
     * @param idList
     */
    void bathRemoveDepartment(@Param("idList") List<Long> idList);

    /**
     * 获取企业的顶级部门id
     *
     * @param tenantId
     * @return
     */
    Long getTopDepartmentId(@Param("tenantId") Long tenantId);


    /**
     * 根据企业id获取所有部门的id
     *
     * @param tenantId
     * @return
     */
    List<Long> getIdListByTenantId(@Param("tenantId") Long tenantId);


}